﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewReferralsAdmissionRequests.aspx.cs" Inherits="referrals.Layouts.referrals.NewReferralsAdmissionRequests" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <link href="../1033/STYLES/referrals/referralsmaster.css" rel="stylesheet" />
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <asp:Panel runat="server" ID="Panel1">
        <asp:GridView runat="server" ID="grdDetails" AutoGenerateColumns="false" ShowHeader="False" OnPageIndexChanging="grdDetails_PageIndexChanging" OnRowDataBound="grdDetails_RowDataBound" OnRowCommand="grdDetails_RowCommand" AllowPaging="True" PageSize="1">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:Table runat="server" ID="tblHeader">
                            <asp:TableRow ID="TableRow1" runat="server">
                                <asp:TableCell ID="TableCell1" runat="server">
                                    <asp:Label ID="lblUID" runat="server" Text='<%# Eval("UID") %>' Visible="false" />
                                    <asp:Label ID="Label1" runat="server" Text='<%# String.Format("{0} {1} {2} {3} {4}", "Name: ", Eval("Title"), Eval("MiddleName"), Eval("FirstName"), Eval("LastName")) %>'></asp:Label>
                                </asp:TableCell>
                                <asp:TableCell>
                                    <asp:Label ID="Label2" runat="server" Text='<%# String.Format("{0} {1}", "NHS Number: ", Eval("NHSNumber")) %>'></asp:Label>
                                </asp:TableCell>
                                <asp:TableCell>
                                    <asp:Label runat="server" ID="lblDOBHeader" Text="Date of Birth: "></asp:Label><asp:Label runat="server" ID="lblDOB" Text='<%#Convert.ToDateTime(Eval("DOB")).ToString("dd/MM/yy") %>'></asp:Label>
                                </asp:TableCell>
                                <asp:TableCell>
                                    <asp:Label ID="lblDate" runat="server" Text='<%# GetAge(Convert.ToDateTime(Eval("DOB"))) %>' />
                                </asp:TableCell>
                                <asp:TableCell>
                                    <asp:Label ID="lblGender" runat="server" Text='<%# Eval("Gender") %>' Visible="False" />
                                </asp:TableCell>
                            </asp:TableRow>
                        </asp:Table>
                        <asp:Table runat="server" ID="Table1">
                            <asp:TableRow ID="TableRow2" runat="server">
                                
                                <asp:TableCell><label>Referral Information</label></asp:TableCell>
                                <asp:TableCell><label>Locality Information</label></asp:TableCell>
                                <asp:TableCell><label>Referral Status</label></asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow3" runat="server">
                                <asp:TableCell>
                                    Date Referred:
                                    <asp:TextBox runat="server" Text='' ID="txtDateReferred"></asp:TextBox>
                                </asp:TableCell>
                                <asp:TableCell>Area: <asp:TextBox runat="server" ID="txtLocality" Text='<%# Eval("Area") %>'></asp:TextBox></asp:TableCell>
                                <asp:TableCell>Urgency:<asp:Label ID="Label4" runat="server">Date Referred: </asp:Label><asp:Label ID="lblUrgency" Visible="False" runat="server" Text='<%# Eval("Urgency") %>' /><asp:Label ID="lblDateReferred" Visible="False" runat="server" Text='<%# Eval("DateReferred") %>' /><asp:DropDownList runat="server" ID="ddlUrgency" /></asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow4" runat="server">
                                <asp:TableCell>
                                    Referred By:
                                    <asp:Label ID="lblReferredBy" Visible="False" runat="server" Text='<%# Eval("ReferredBy") %>' /><asp:DropDownList runat="server" ID="ddlReferredBy" />
                                </asp:TableCell>
                                <asp:TableCell>
                                    Current Location:
                                    <asp:Label runat="server" ID="lblCurrentLocation" Visible="False" Text='<%# Eval("Location") %>'></asp:Label><asp:DropDownList runat="server" ID="ddlCurrentLocation" />
                                </asp:TableCell>
                                <asp:TableCell>
                                    Stage:
                                    <asp:Label ID="lblCpaStage" runat="server" Text='<%# Eval("Type") %>' Visible="false" /><asp:DropDownList runat="server" ID="ddlCpaStage" />
                                </asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow5" runat="server">
                                <asp:TableCell>
                                    <asp:Label ID="Label3" runat="server">Reason Referred: </asp:Label><asp:Label ID="lblReasons" runat="server" Text='<%# Eval("ReasonReferred") %>' Visible="false" /><asp:DropDownList runat="server" ID="ddlReasons" />
                                </asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                                <asp:TableCell>Papers Location:
                                    <asp:TextBox runat="server" ID="txtPapersLocation" Text='<%# Eval("PapersLocation") %>'></asp:TextBox></asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow6" runat="server">
                                <asp:TableCell>
                                    <asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Text='<%# Eval("Description") %>'></asp:TextBox>
                                </asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow7" runat="server">
                                <asp:TableCell>During Meeting</asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow8" runat="server">
                                <asp:TableCell>&nbsp;</asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow9" runat="server">
                                <asp:TableCell><label>1. Accept or Reject Referral</label></asp:TableCell>
                                <asp:TableCell><label>2. Allocate if Neccessary</label></asp:TableCell>
                                <asp:TableCell><label>3. Document Discussion</label></asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow10" runat="server">
                                <asp:TableCell>
                                    Outcome:
                                    <asp:Label ID="lblInitialOutcome" Visible="False" runat="server" Text='<%# Eval("RefOutcome") %>' /><asp:DropDownList runat="server" ID="ddlInitialOutcome" />
                                </asp:TableCell>
                                <asp:TableCell>
                                    Clinician 1:
                                    <asp:Label ID="lblContactBy1" runat="server" Text='<%# Eval("ContactBy1") %>' Visible="false" /><asp:DropDownList runat="server" ID="ddlContactBy1" />
                                </asp:TableCell>
                                <asp:TableCell>
                                    <asp:TextBox ID="TextBox2" runat="server" TextMode="MultiLine" Text='<%# Eval("RefDiscussion") %>'></asp:TextBox></asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow11" runat="server">
                                <asp:TableCell>&nbsp;</asp:TableCell>
                                <asp:TableCell>
                                    Clinician 2:
                                    <asp:Label ID="lblContactBy2" runat="server" Text='<%# Eval("ContactBy2") %>' Visible="false" /><asp:DropDownList ID="ddlContactBy2" runat="server" />
                                </asp:TableCell>
                                <asp:TableCell>
                                    <asp:Label ID="lblDiscussNextWeek" runat="server" Text='<%# Eval("DNW") %>' Visible="false" />
                                    <asp:RadioButtonList ID="rblDiscussNextWeek" runat="server" RepeatDirection="Horizontal">
                                        <asp:ListItem Text="Yes" Value="yes" />
                                        <asp:ListItem Text="No" Value="no" />
                                    </asp:RadioButtonList>
                                </asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow12" runat="server">
                                <asp:TableCell ColumnSpan="2"><label>4. Track Progress - These fields must be completed as they relate to  Key Performance Indicators</label></asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow20" runat="server">
                                <asp:TableCell>&nbsp;</asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow13" runat="server">
                                <asp:TableCell><label>Review</label></asp:TableCell>
                                <asp:TableCell><label>Response</label></asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow14" runat="server">
                                <asp:TableCell>This referral must be reviewed by:
                                </asp:TableCell>
                                <asp:TableCell>The outcome of the review must be communicated to the referrer by:</asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow15" runat="server">
                                <asp:TableCell>
                                    <asp:Label ID="Label5" runat="server">Date Reviewed </asp:Label><asp:Label ID="lblDateReviewed" runat="server" Text='<%# Eval("Date") %>' Visible="false" /><asp:TextBox runat="server" ID="txtDateReviewed" Text=''></asp:TextBox></asp:TableCell>
                                <asp:TableCell>
                                    <asp:Label ID="lblResponseOn" runat="server" Visible="False" Text='<%# Eval("referralResponse") %>'></asp:Label>Response On
                                    <asp:TextBox runat="server" ID="txtResponseOn" Text=''></asp:TextBox></asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow16" runat="server">
                                <asp:TableCell>&nbsp;</asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow19" runat="server">
                                <asp:TableCell><label>Assessment</label></asp:TableCell>
                                <asp:TableCell><label>Report</label></asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow17" runat="server">
                                <asp:TableCell>This assessment must be completed by 17/06/2013</asp:TableCell>
                                <asp:TableCell>A report on this referral must be sent by:</asp:TableCell>
                                <asp:TableCell>
                                    Final Outcome:
                                    <asp:Label ID="lblFinalOutcome" Visible="False" runat="server" Text='<%# Eval("FOutcome") %>' /><asp:DropDownList runat="server" ID="ddlFinalOutcome" />
                                </asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow18" runat="server">
                                <asp:TableCell>Assessment Date:
                                    <asp:Label ID="lblAssessmentDate" runat="server" Text='<%# Eval("AssessmentDate") %>' Visible="false" /><asp:TextBox runat="server" ID="txtAssessmentDate" Text=''></asp:TextBox></asp:TableCell>
                                <asp:TableCell>Date Report Sent:
                                    <asp:Label ID="lblReportSent" Visible="False" runat="server" Text='<%# Eval("ReportSent") %>' /><asp:TextBox runat="server" ID="txtReportSent" Text=''></asp:TextBox></asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                            </asp:TableRow>
                            <asp:TableRow ID="TableRow21" runat="server">
                                <asp:TableCell>&nbsp;</asp:TableCell>
                                <asp:TableCell>&nbsp;</asp:TableCell>
                                <asp:TableCell><asp:Button ID="btnUpdate" runat="server" CommandName="UpdateAndClose" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" Text="Update and Close" /></asp:TableCell>
                            </asp:TableRow>
                        </asp:Table>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <%--<asp:GridView runat="server" ID="gridView3" AutoGenerateColumns="False" ShowHeader="False" GridLines="None" OnRowDataBound="OnRowDataBound" OnPageIndexChanging="gridView3_PageIndexChanging" AllowPaging="True" PageSize = "1">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <table>
                            
                        </table>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>--%>
    </asp:Panel>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
New Referrals Admission Requests
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
New Referrals Admission Requests
</asp:Content>
